from openai import OpenAI
import os


def get_response():
    client = OpenAI(
        api_key="sk-kp9S9IWRGNPpUUGzmdsadsaHFcuWhifs9bNe0IWsT",
        base_url="https://api.openai.com/v1",
        #base_url="https://gateway.ai.cloudflare.com/v1/cda5d11804da1f4a373835ebeb2129bf/fanlichun/openai",
    )
    completion = client.chat.completions.create(
        model="o1-mini",
        messages=[{'role': 'user', 'content': '你好'}, {'role': 'assistant', 'content': '你好！有什么可以帮助你的吗？'},
                  {'role': 'user', 'content': '你的版本？'}],
        )
    #print(completion.choices[0].message.content)
    print(completion.choices)
    #print(completion.choices[0].text.strip())
    #for chunk in completion:
    #    print(chunk.model_dump_json())


if __name__ == '__main__':
    get_response()
